package com.gg.cart.contorller;

import helpers.baseservlet.BaseServlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.gg.cart.service.CartService;

@WebServlet("/cart/ChangeCartByCidServlet")
public class ChangeCartByCidServlet extends BaseServlet {
	@Autowired
	private CartService cartService;
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String key=request.getParameter("key");
				String cid=request.getParameter("cid");
				if(key.equals("jian")) {
					cartService.changeCartByCid(cid,-1);
					
				}else
					cartService.changeCartByCid(cid,1);
	}

}
